package com.fortune.rainshine.service.controller;

import com.fortune.rainshine.service.service.ShopService;
import com.fortune.rainshinecommon.model.ShopModel;
import com.fortune.rainshinecommon.query.ShopQuery;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: rainShine
 * @description:
 * @author: tangyn
 * @create: 2019-04-06
 **/
@Controller
@RequestMapping("/service/map")
public class MapController {
    @Autowired
    private ShopService service;

    @RequestMapping()
    public String map() {
        return "map/map.html";
    }

    @PostMapping("/shopList")
    @ResponseBody

    public List<ShopModel> shopList() {
        ShopQuery query = new ShopQuery();
        return service.getMapShops(query);
    }
}
